package 曾世昌12_19.demo2;

import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

public class MianApp {
    public static void main(String[] args) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        Phone phone = new Phone( "华为", "黑色", 5999, 6.4 );
        String brand = BeanUtils.getProperty( phone, "brand" );
        String color = BeanUtils.getProperty( phone, "color" );
        String price = BeanUtils.getProperty( phone, "price" );
        String size = BeanUtils.getProperty( phone, "size" );
        System.out.println("品牌："+brand+"\r\n"+"颜色："+color+"\r\n"+"价格："+Integer.parseInt( price )+"\r\n"+"尺寸："+Double.parseDouble( size ));
    }
}
